package hacker_rank._101hack_mar14;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class RectangularGame {

	public static void main(String[] args) throws NumberFormatException,
			IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int N = Integer.parseInt(br.readLine());

		int[] u = new int[N];
		int[] v = new int[N];
		
		for(int i = 0; i < N; i++) {
			String[] tmp = br.readLine().split(" ");
			
			u[i] = Integer.parseInt(tmp[0]);
			v[i] = Integer.parseInt(tmp[1]);
		}
		
		int up = -1;
		int vp = -1;
		
		int uMin = Integer.MAX_VALUE;
		int vMin = Integer.MAX_VALUE;
		for(int i = 0;i < N; i++) {
			if(u[i] < uMin) {
				uMin = u[i];
				up = i;
			}
			if(v[i] < vMin) {
				vMin = v[i];
				vp = i;
			}
			
			
		}
		System.out.println(((long)u[up]) * ((long) v[vp]));
		
		
		

	}

}
